/** 主表 **/

import Layout from '@/layout'; // 导入布局组件

// 定义路由配置对象：masterRouter
const masterRouter = {
  path: '/master', // 定义主路由的路径
  component: Layout, // 指定当访问该路由时要渲染的组件为Layout组件
  redirect: '', // 定义路由重定向的路径为空，即访问/master时会重定向到/master/Departments
  name: 'master', // 路由配置的一个名称
  alwaysShow: true, // 侧边栏菜单的显示控制，true：无论是否有子路由，该菜单栏都会显示，false：如果没有子路由，则不会显示
  // 自定义的元信息对象，包含一些与该路由相关的额外数据。标题；路由的唯一标识代码；图标；缓存该路由对应组件；国际化代码
  meta: { title: '主表', code: 'MASTER-1000', icon: 'el-icon-menu', noCache: false, i18nCode: 'master.master' },
  // 配置子路由
  children: [
    {
      path: 'Departments', // 子路由的路径
      name: 'Departments', // 子路由的名称
      component: () => import('@/views/master/departments/components/departments-list'), // 使用动态导入的方式加载组件，当用户访问该路由时才会加载对应的组件，实现代码分割。
      meta: { title: '部门主表', code: 'DEPARTMENT-1000', icon: '', noCache: false, i18nCode: 'master.department' }
    },
    {
      path: 'SerialNumber',
      name: 'SerialNumber',
      component: () => import('@/views/master/serialnumber/components/serialnumber-list'),
      meta: { title: '制番主表', code: 'SERIALNUM-1000', icon: '', noCache: false, i18nCode: 'master.serialNumber' }
    },
    {
      path: 'Currency',
      name: 'Currency',
      component: () => import('@/views/master/currency/components/currency-list'),
      meta: { title: '币种主表', code: 'CURRENCY-1000', icon: '', noCache: false, i18nCode: 'master.currency' }
    },
    {
      path: 'CurrencyRate',
      name: 'CurrencyRate',
      component: () => import('@/views/master/currencyrate/components/currencyrate-list'),
      meta: { title: '币种汇率主表', code: 'CURRENCYRATE-1000', icon: '', noCache: false, i18nCode: 'master.currencyRate' }
    },
    {
      path: 'Test',
      name: 'Test',
      component: () => import('@/views/test/test'),
      meta: { title: '十二个月测试画面', code: 'TEST-1000', icon: '', noCache: false }
    }
  ]
};

export default masterRouter; // 将路由配置对象：masterRouter导出
